﻿using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using PoemGame.Domain.GameAggregate;
using PoemGame.Domain.Services;

namespace PoemGameWebTest.Pages
{
    public class IndexModel : PageModel
    {
        private readonly ILogger<IndexModel> _logger;
        private readonly IDomainServiceFactory<ICheckGameConditionService> factory;

        public String display;
        public IndexModel(ILogger<IndexModel> logger, IDomainServiceFactory<ICheckGameConditionService> factory)
        {
            _logger = logger;
            this.factory = factory;
        }

        public async Task OnGet()
        {
            var service=factory.GetService(new GameType("Duishi", ""));
            var res=await service.CheckGameCondition("花间一壶酒");
            display = res.ToString();

        }
    }
}